from django_filters import rest_framework as filters

from base.models import Business, Environment, Application, ApplicationTag, Instances, Language, Resource


class BusinessFilter(filters.FilterSet):
    class Meta:
        model = Business
        fields = (
            'name',
        )


class EnvironmentFilter(filters.FilterSet):
    class Meta:
        model = Environment
        fields = (
            'name',
            'business',
            'instances'
        )


class ApplicationsFilter(filters.FilterSet):
    class Meta:
        model = Application
        fields = (
            'name',
            'business',
            'resource',
        )


class ApplicationsTagFilter(filters.FilterSet):
    class Meta:
        model = ApplicationTag
        fields = (
            'application',
        )


class InstancesFilter(filters.FilterSet):
    class Meta:
        model = Instances
        fields = (
            'instance_id',
            'private_ip',
            'public_ip',
            'vpc_id',
            'subnet_id',
            'instance_type',
            'key_name',
            'status',

        )


class LanguageFilter(filters.FilterSet):
    class Meta:
        model = Language
        fields = (
            'name',
        )


class ResourceFilter(filters.FilterSet):
    class Meta:
        model = Resource
        fields = (
            'name',
        )
